<%-- 
    Document   : user_new
    Created on : Nov 20, 2008, 2:00:18 PM
    Author     : Vyor
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<table>
    <tr>
        <td class="menucon">
            <html:link action="/usr_getusers.do" title="Go to main.">Users</html:link>
        </td>
    </tr>
</table>
<html:messages id="messages" property="customMessage" message="true">
    <div class="heading4"><bean:write name="messages"/></div>
</html:messages>
<html:errors/>
<html:messages id="messages" message="true">
    <ul>
        <li><bean:write name="messages"/></li>
    </ul>
</html:messages>
<html:form method="POST" action="/usr_save.do">
    <table cellspacing="0">
        <tr>
            <td>User Name</td>
            <td>:</td>
            <td><html:text property="username"/></td>
        </tr>
        <tr>
            <td>Password</td>
            <td>:</td>
            <td><html:password property="password"/></td>
        </tr>
        <tr>
            <td>Password Retype</td>
            <td>:</td>
            <td><html:password property="passwordRetype"/></td>
        </tr>        
        <tr>
            <td>Name</td>
            <td>:</td>
            <td><html:text property="nama"/></td>
        </tr>
        <tr>
            <td>Address</td>
            <td>:</td>
            <td><html:text property="alamat"/></td>
        </tr>
        <tr>
            <td>Phone Number</td>
            <td>:</td>
            <td><html:text property="telp"/> e.g. 123-456789</td>
        </tr>
        <tr>
            <td>Email</td>
            <td>:</td>
            <td><html:text property="email"/></td>
        </tr>
        <tr>
            <td>Department</td>
            <td>:</td>
            <td>                
                <html:select property="idDepartemen">
                    <c:forEach items="${departemens}" var="departemen">
                        <html:option value="${departemen.id}">${departemen.nama} (${departemen.kode})</html:option>
                    </c:forEach>
                </html:select>
            </td>
        </tr>
        <tr>
            <td>Branch Office</td>
            <td>:</td>
            <td>                
                <html:select property="idCabang">
                    <c:forEach items="${cabangs}" var="cabang">
                        <html:option value="${cabang.id}">${cabang.kota} (${cabang.kode})</html:option>
                    </c:forEach>
                </html:select>
            </td>
        </tr>
        <tr>
            <td colspan="3"><html:submit value="Save Now"/></td>
        </tr>
    </table>
</html:form>